package cn.guo.service.impl;


import java.util.List;

import cn.guo.dao.IFilmDao;
import cn.guo.entity.Film;
import cn.guo.service.IFilmService;


public class FilmService implements IFilmService {
	
	// 容器注入
	private IFilmDao  filmDao;
	
	public void setFilmDao(IFilmDao filmDao) {
		this.filmDao = filmDao;
	}

	public void delete(int id) {
		filmDao.delete(id);
	}

	public void deleteMany(int[] ids) {
		if (ids != null && ids.length >0) {
			for (int id : ids){
				delete(id);
			}
		}
	}

	public Film findById(int id) {
		return filmDao.findById(id);
	}

	public List<Film> getAll() {
		return filmDao.getAll();
	}

	public List<Film> getAll(String fname) {
		return filmDao.getAll(fname);
	}

	public void save(Film film) {
		filmDao.save(film);
	}

	public void update(Film film) {
		filmDao.update(film);
	}

}

